#ifndef WATERMARKWINDOW_H
#define WATERMARKWINDOW_H

#include <QMainWindow>
#include "windowinfo.h"

class WatermarkWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit WatermarkWindow(QWidget *parent = 0);
    ~WatermarkWindow();

    void setParentWid(const WID &wid);

    QString processName() const;
    void setProcessName(const QString &processName);


protected:
    virtual void paintEvent(QPaintEvent *event);
    virtual void closeEvent(QCloseEvent *event);
    virtual void timerEvent(QTimerEvent *event);
    virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);

signals:
    void quitWindow(const WID &wid);

private:
    void drawTextWM();
    void drawImageWM();
    void drawQRCodeWM();
    void drawDarkWM();
    void drawMatrixWM();

private:
    void calculatePosition(int position, int width, int height, int &x, int &y);

private:
    int m_datetimeId;
    int m_topmostId;

    WID m_parentWid;
    QRect m_parentRect;
    QString m_processName;
};

#endif // WATERMARKWINDOW_H
